<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>

        <script src="node_modules/@babel/standalone/babel.js"></script>
        <script src="node_modules/react/umd/react.development.js"></script>
        <script src="node_modules/react-dom/umd/react-dom.development.js"></script>
</head>

<body>
    <div id="app"></div>





    <script type="text/babel">
//这是原生JS的创建实例对象的方法
// function Person(name,age,gender) {
// this.name=name
// this.age=age  
// }
// Person.prototype.sayhello=function(){
//     window.alert('hello'+this.name)
// }
// var person=new Person()


//es创造实例对象
class Person{
constructor(name,age,gender){
this.name=name
this.age=age
this.gender=gender
this.type='哈哈'
    }
 sayhello(){
    window.alert('hello'+this.name)
 }
}
const s0=new Person()   
// typeof Person // "function"
// Person === Person.prototype.constructor // true
//继承对象
class Student extends Person{
    constructor(name,age,gender,id){
        super(name,age,gender)
        this.id=id
    }
    study(){
    window.alert(this.name+ "在学习")
   }
 }

class Teacher extends Person{
    constructor(name,age,gender){
        super(name,age,gender)
    }
 }

const s1=new Student('张三',19,0,20152204175);
const s2=new Teacher('老师',30,1)

</script>

</body>

</html>